/** WPI CS509 cisco Stratego login reply message
 * 
 */
package edu.wpi.cs509.messages.client;

import edu.wpi.cs509.clientlogic.UserSession;


/**
 * This is the reply message for a user login request.
 * @author sparadis
 *
 */
public class MsgLoginReply extends MsgClientContext {

	/**
	 * serializable version number
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * Login success/fail return values.
	 *
	 */
	public enum LoginResult {
		LoggedIn,
		InvalidCredentials
	}
	
	/** 
	 * The user account for this login. This may be null if the login failed. 
	 */
	protected LoginResult loginRes;
	
	/**
	 * Constructor, empty so far.
	 */
	public MsgLoginReply(LoginResult res) {
		this.loginRes = res;
	}

	/**
	 * @see edu.wpi.cs509.messages.MsgBc#rxExecute()
	 * Acknowledge the login request. 
	 */
	@Override
	public void rxExecute() {
		//Give the login result to the client code.
		getCl().receiveLogin(loginRes);
	}

}
